package com.taskcollection.mybitsspring;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created by Administrator on 2016/8/14 0014.
 */
public class AgencySubject implements InvocationHandler {
    private RealSubject realSubject;
    public AgencySubject(RealSubject realSubject){
        this.realSubject = realSubject;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("执行前");
        Object obj = method.invoke(realSubject,args);
        System.out.println("执行后");
        return obj;
    }
}
